<template>
  <div class="featured-container">
    <van-nav-bar
      title="精选内容"
      left-arrow
      @click-left="onClickLeft"
    />
    
    <!-- 分类标签 -->
    <van-tabs v-model:active="activeTab" sticky>
      <van-tab title="全部">
        <featured-list :type="'all'" />
      </van-tab>
      <van-tab title="课程">
        <featured-list :type="'course'" />
      </van-tab>
      <van-tab title="文章">
        <featured-list :type="'article'" />
      </van-tab>
      <van-tab title="视频">
        <featured-list :type="'video'" />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import FeaturedList from '@/components/featured/FeaturedList.vue'

const router = useRouter()
const activeTab = ref(0)

const onClickLeft = () => {
  router.back()
}
</script>

<style lang="scss" scoped>
.featured-container {
  min-height: 100vh;
  background-color: #f7f8fa;
  
  :deep(.van-tabs__wrap) {
    background-color: #fff;
  }
}
</style>
